\(\int \frac {(a+b \arctan (c x))^2}{x (d+e x^2)} \, dx\) [1265]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (warning: unable to verify)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 23, antiderivative size = 637 \[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\frac {2 (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d}+\frac {(a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{d}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1+i c x}\right )}{2 d}+\frac {b^2 \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{2 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 d} \]

[Out]

-2*(a+b*arctan(c*x))^2*arctanh(-1+2/(1+I*c*x))/d+(a+b*arctan(c*x))^2*ln(2/(1-I*c*x))/d-1/2*(a+b*arctan(c*x))^2
*ln(2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^(1/2)))/d-1/2*(a+b*arctan(c*x))^2*ln(2*c*((-d)^(1/2
)+x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)+I*e^(1/2)))/d-I*b*(a+b*arctan(c*x))*polylog(2,1-2/(1-I*c*x))/d-I*b*(a+b*a
rctan(c*x))*polylog(2,1-2/(1+I*c*x))/d+I*b*(a+b*arctan(c*x))*polylog(2,-1+2/(1+I*c*x))/d+1/2*I*b*(a+b*arctan(c
*x))*polylog(2,1-2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^(1/2)))/d+1/2*I*b*(a+b*arctan(c*x))*po
lylog(2,1-2*c*((-d)^(1/2)+x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)+I*e^(1/2)))/d+1/2*b^2*polylog(3,1-2/(1-I*c*x))/d-
1/2*b^2*polylog(3,1-2/(1+I*c*x))/d+1/2*b^2*polylog(3,-1+2/(1+I*c*x))/d-1/4*b^2*polylog(3,1-2*c*((-d)^(1/2)-x*e
^(1/2))/(1-I*c*x)/(c*(-d)^(1/2)-I*e^(1/2)))/d-1/4*b^2*polylog(3,1-2*c*((-d)^(1/2)+x*e^(1/2))/(1-I*c*x)/(c*(-d)
^(1/2)+I*e^(1/2)))/d

Rubi [A] (verified)

Time = 0.48 (sec) , antiderivative size = 637, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {5100, 4942, 5108, 5004, 5114, 6745, 4968} \[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\frac {2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right ) (a+b \arctan (c x))^2}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{(1-i c x) \left (c \sqrt {-d}-i \sqrt {e}\right )}\right )}{2 d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{(1-i c x) \left (c \sqrt {-d}+i \sqrt {e}\right )}\right )}{2 d}-\frac {i b \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))}{d}-\frac {i b \operatorname {PolyLog}\left (2,1-\frac {2}{i c x+1}\right ) (a+b \arctan (c x))}{d}+\frac {i b \operatorname {PolyLog}\left (2,\frac {2}{i c x+1}-1\right ) (a+b \arctan (c x))}{d}+\frac {\log \left (\frac {2}{1-i c x}\right ) (a+b \arctan (c x))^2}{d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right )}{4 d}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{i c x+1}\right )}{2 d}+\frac {b^2 \operatorname {PolyLog}\left (3,\frac {2}{i c x+1}-1\right )}{2 d} \]

[In]

Int[(a + b*ArcTan[c*x])^2/(x*(d + e*x^2)),x]

[Out]

(2*(a + b*ArcTan[c*x])^2*ArcTanh[1 - 2/(1 + I*c*x)])/d + ((a + b*ArcTan[c*x])^2*Log[2/(1 - I*c*x)])/d - ((a +
b*ArcTan[c*x])^2*Log[(2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/(2*d) - ((a + b*Arc
Tan[c*x])^2*Log[(2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/(2*d) - (I*b*(a + b*ArcT
an[c*x])*PolyLog[2, 1 - 2/(1 - I*c*x)])/d - (I*b*(a + b*ArcTan[c*x])*PolyLog[2, 1 - 2/(1 + I*c*x)])/d + (I*b*(
a + b*ArcTan[c*x])*PolyLog[2, -1 + 2/(1 + I*c*x)])/d + ((I/2)*b*(a + b*ArcTan[c*x])*PolyLog[2, 1 - (2*c*(Sqrt[
-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/d + ((I/2)*b*(a + b*ArcTan[c*x])*PolyLog[2, 1 - (2*
c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/d + (b^2*PolyLog[3, 1 - 2/(1 - I*c*x)])/(2*
d) - (b^2*PolyLog[3, 1 - 2/(1 + I*c*x)])/(2*d) + (b^2*PolyLog[3, -1 + 2/(1 + I*c*x)])/(2*d) - (b^2*PolyLog[3,
1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/(4*d) - (b^2*PolyLog[3, 1 - (2*c*(Sq
rt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/(4*d)

Rule 4942

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_)/(x_), x_Symbol] :> Simp[2*(a + b*ArcTan[c*x])^p*ArcTanh[1 - 2/(1 +
 I*c*x)], x] - Dist[2*b*c*p, Int[(a + b*ArcTan[c*x])^(p - 1)*(ArcTanh[1 - 2/(1 + I*c*x)]/(1 + c^2*x^2)), x], x
] /; FreeQ[{a, b, c}, x] && IGtQ[p, 1]

Rule 4968

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^2/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x])^2)*(Log[
2/(1 - I*c*x)]/e), x] + (Simp[(a + b*ArcTan[c*x])^2*(Log[2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/e), x] + S
imp[I*b*(a + b*ArcTan[c*x])*(PolyLog[2, 1 - 2/(1 - I*c*x)]/e), x] - Simp[I*b*(a + b*ArcTan[c*x])*(PolyLog[2, 1
 - 2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/e), x] - Simp[b^2*(PolyLog[3, 1 - 2/(1 - I*c*x)]/(2*e)), x] + Si
mp[b^2*(PolyLog[3, 1 - 2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/(2*e)), x]) /; FreeQ[{a, b, c, d, e}, x] &&
NeQ[c^2*d^2 + e^2, 0]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5100

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^2)^(q_.), x_Symbol] :> With
[{u = ExpandIntegrand[(a + b*ArcTan[c*x])^p, (f*x)^m*(d + e*x^2)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b,
 c, d, e, f, m}, x] && IntegerQ[q] && IGtQ[p, 0] && ((EqQ[p, 1] && GtQ[q, 0]) || IntegerQ[m])

Rule 5108

Int[(ArcTanh[u_]*((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[1/2, Int[L
og[1 + u]*((a + b*ArcTan[c*x])^p/(d + e*x^2)), x], x] - Dist[1/2, Int[Log[1 - u]*((a + b*ArcTan[c*x])^p/(d + e
*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[e, c^2*d] && EqQ[u^2 - (1 - 2*(I/(I - c*x)))^
2, 0]

Rule 5114

Int[(Log[u_]*((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(-I)*(a + b*Ar
cTan[c*x])^p*(PolyLog[2, 1 - u]/(2*c*d)), x] + Dist[b*p*(I/2), Int[(a + b*ArcTan[c*x])^(p - 1)*(PolyLog[2, 1 -
 u]/(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[e, c^2*d] && EqQ[(1 - u)^2 - (1 - 2
*(I/(I - c*x)))^2, 0]

Rule 6745

Int[(u_)*PolyLog[n_, v_], x_Symbol] :> With[{w = DerivativeDivides[v, u*v, x]}, Simp[w*PolyLog[n + 1, v], x] /
;  !FalseQ[w]] /; FreeQ[n, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {(a+b \arctan (c x))^2}{d x}-\frac {e x (a+b \arctan (c x))^2}{d \left (d+e x^2\right )}\right ) \, dx \\ & = \frac {\int \frac {(a+b \arctan (c x))^2}{x} \, dx}{d}-\frac {e \int \frac {x (a+b \arctan (c x))^2}{d+e x^2} \, dx}{d} \\ & = \frac {2 (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d}-\frac {(4 b c) \int \frac {(a+b \arctan (c x)) \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d}-\frac {e \int \left (-\frac {(a+b \arctan (c x))^2}{2 \sqrt {e} \left (\sqrt {-d}-\sqrt {e} x\right )}+\frac {(a+b \arctan (c x))^2}{2 \sqrt {e} \left (\sqrt {-d}+\sqrt {e} x\right )}\right ) \, dx}{d} \\ & = \frac {2 (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d}+\frac {(2 b c) \int \frac {(a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d}-\frac {(2 b c) \int \frac {(a+b \arctan (c x)) \log \left (2-\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d}+\frac {\sqrt {e} \int \frac {(a+b \arctan (c x))^2}{\sqrt {-d}-\sqrt {e} x} \, dx}{2 d}-\frac {\sqrt {e} \int \frac {(a+b \arctan (c x))^2}{\sqrt {-d}+\sqrt {e} x} \, dx}{2 d} \\ & = \frac {2 (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d}+\frac {(a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{d}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 d}+\frac {\left (i b^2 c\right ) \int \frac {\operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d}-\frac {\left (i b^2 c\right ) \int \frac {\operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{d} \\ & = \frac {2 (a+b \arctan (c x))^2 \text {arctanh}\left (1-\frac {2}{1+i c x}\right )}{d}+\frac {(a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{d}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,-1+\frac {2}{1+i c x}\right )}{d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 d}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2}{1+i c x}\right )}{2 d}+\frac {b^2 \operatorname {PolyLog}\left (3,-1+\frac {2}{1+i c x}\right )}{2 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 d}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 d} \\ \end{align*}

Mathematica [A] (warning: unable to verify)

Time = 10.89 (sec) , antiderivative size = 1264, normalized size of antiderivative = 1.98 \[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\frac {24 a^2 \log (x)-12 a^2 \log \left (d+e x^2\right )-24 a b \left (-i \arctan (c x)^2+2 i \arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right ) \arctan \left (\frac {c e x}{\sqrt {c^2 d e}}\right )-2 \arctan (c x) \log \left (1-e^{2 i \arctan (c x)}\right )+\left (-\arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right )+\arctan (c x)\right ) \log \left (1+\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )+\left (\arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right )+\arctan (c x)\right ) \log \left (\frac {-2 \sqrt {c^2 d e} e^{2 i \arctan (c x)}+e \left (-1+e^{2 i \arctan (c x)}\right )+c^2 d \left (1+e^{2 i \arctan (c x)}\right )}{c^2 d-e}\right )+i \left (\arctan (c x)^2+\operatorname {PolyLog}\left (2,e^{2 i \arctan (c x)}\right )\right )-\frac {1}{2} i \left (\operatorname {PolyLog}\left (2,\frac {\left (-c^2 d-e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )+\operatorname {PolyLog}\left (2,-\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )\right )\right )+b^2 \left (-i \pi ^3+16 i \arctan (c x)^3+24 \arctan (c x)^2 \log \left (1-e^{-2 i \arctan (c x)}\right )+24 \arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right ) \arctan (c x) \log \left (1+\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )-24 \arctan (c x)^2 \log \left (1+\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )-24 \arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right ) \arctan (c x) \log \left (\frac {-2 \sqrt {c^2 d e} e^{2 i \arctan (c x)}+e \left (-1+e^{2 i \arctan (c x)}\right )+c^2 d \left (1+e^{2 i \arctan (c x)}\right )}{c^2 d-e}\right )-24 \arctan (c x)^2 \log \left (\frac {-2 \sqrt {c^2 d e} e^{2 i \arctan (c x)}+e \left (-1+e^{2 i \arctan (c x)}\right )+c^2 d \left (1+e^{2 i \arctan (c x)}\right )}{c^2 d-e}\right )+24 \arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right ) \arctan (c x) \log \left (\frac {2 i c^2 d-2 i \sqrt {c^2 d e}+2 c \left (-e+\sqrt {c^2 d e}\right ) x}{\left (c^2 d-e\right ) (i+c x)}\right )+12 \arctan (c x)^2 \log \left (\frac {2 i c^2 d-2 i \sqrt {c^2 d e}+2 c \left (-e+\sqrt {c^2 d e}\right ) x}{\left (c^2 d-e\right ) (i+c x)}\right )-24 \arcsin \left (\sqrt {\frac {c^2 d}{c^2 d-e}}\right ) \arctan (c x) \log \left (1+\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) (\cos (2 \arctan (c x))+i \sin (2 \arctan (c x)))}{c^2 d-e}\right )+12 \arctan (c x)^2 \log \left (1+\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) (\cos (2 \arctan (c x))+i \sin (2 \arctan (c x)))}{c^2 d-e}\right )+24 i \arctan (c x) \operatorname {PolyLog}\left (2,e^{-2 i \arctan (c x)}\right )+12 i \arctan (c x) \operatorname {PolyLog}\left (2,\frac {\left (-c^2 d-e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )+12 i \arctan (c x) \operatorname {PolyLog}\left (2,-\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )+12 \operatorname {PolyLog}\left (3,e^{-2 i \arctan (c x)}\right )-6 \operatorname {PolyLog}\left (3,\frac {\left (-c^2 d-e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )-6 \operatorname {PolyLog}\left (3,-\frac {\left (c^2 d+e+2 \sqrt {c^2 d e}\right ) e^{2 i \arctan (c x)}}{c^2 d-e}\right )\right )}{24 d} \]

[In]

Integrate[(a + b*ArcTan[c*x])^2/(x*(d + e*x^2)),x]

[Out]

(24*a^2*Log[x] - 12*a^2*Log[d + e*x^2] - 24*a*b*((-I)*ArcTan[c*x]^2 + (2*I)*ArcSin[Sqrt[(c^2*d)/(c^2*d - e)]]*
ArcTan[(c*e*x)/Sqrt[c^2*d*e]] - 2*ArcTan[c*x]*Log[1 - E^((2*I)*ArcTan[c*x])] + (-ArcSin[Sqrt[(c^2*d)/(c^2*d -
e)]] + ArcTan[c*x])*Log[1 + ((c^2*d + e + 2*Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e)] + (ArcSin[Sqrt[
(c^2*d)/(c^2*d - e)]] + ArcTan[c*x])*Log[(-2*Sqrt[c^2*d*e]*E^((2*I)*ArcTan[c*x]) + e*(-1 + E^((2*I)*ArcTan[c*x
])) + c^2*d*(1 + E^((2*I)*ArcTan[c*x])))/(c^2*d - e)] + I*(ArcTan[c*x]^2 + PolyLog[2, E^((2*I)*ArcTan[c*x])])
- (I/2)*(PolyLog[2, ((-(c^2*d) - e + 2*Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e)] + PolyLog[2, -(((c^2
*d + e + 2*Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e))])) + b^2*((-I)*Pi^3 + (16*I)*ArcTan[c*x]^3 + 24*
ArcTan[c*x]^2*Log[1 - E^((-2*I)*ArcTan[c*x])] + 24*ArcSin[Sqrt[(c^2*d)/(c^2*d - e)]]*ArcTan[c*x]*Log[1 + ((c^2
*d + e + 2*Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e)] - 24*ArcTan[c*x]^2*Log[1 + ((c^2*d + e + 2*Sqrt[
c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e)] - 24*ArcSin[Sqrt[(c^2*d)/(c^2*d - e)]]*ArcTan[c*x]*Log[(-2*Sqrt[
c^2*d*e]*E^((2*I)*ArcTan[c*x]) + e*(-1 + E^((2*I)*ArcTan[c*x])) + c^2*d*(1 + E^((2*I)*ArcTan[c*x])))/(c^2*d -
e)] - 24*ArcTan[c*x]^2*Log[(-2*Sqrt[c^2*d*e]*E^((2*I)*ArcTan[c*x]) + e*(-1 + E^((2*I)*ArcTan[c*x])) + c^2*d*(1
 + E^((2*I)*ArcTan[c*x])))/(c^2*d - e)] + 24*ArcSin[Sqrt[(c^2*d)/(c^2*d - e)]]*ArcTan[c*x]*Log[((2*I)*c^2*d -
(2*I)*Sqrt[c^2*d*e] + 2*c*(-e + Sqrt[c^2*d*e])*x)/((c^2*d - e)*(I + c*x))] + 12*ArcTan[c*x]^2*Log[((2*I)*c^2*d
 - (2*I)*Sqrt[c^2*d*e] + 2*c*(-e + Sqrt[c^2*d*e])*x)/((c^2*d - e)*(I + c*x))] - 24*ArcSin[Sqrt[(c^2*d)/(c^2*d
- e)]]*ArcTan[c*x]*Log[1 + ((c^2*d + e + 2*Sqrt[c^2*d*e])*(Cos[2*ArcTan[c*x]] + I*Sin[2*ArcTan[c*x]]))/(c^2*d
- e)] + 12*ArcTan[c*x]^2*Log[1 + ((c^2*d + e + 2*Sqrt[c^2*d*e])*(Cos[2*ArcTan[c*x]] + I*Sin[2*ArcTan[c*x]]))/(
c^2*d - e)] + (24*I)*ArcTan[c*x]*PolyLog[2, E^((-2*I)*ArcTan[c*x])] + (12*I)*ArcTan[c*x]*PolyLog[2, ((-(c^2*d)
 - e + 2*Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e)] + (12*I)*ArcTan[c*x]*PolyLog[2, -(((c^2*d + e + 2*
Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e))] + 12*PolyLog[3, E^((-2*I)*ArcTan[c*x])] - 6*PolyLog[3, ((-
(c^2*d) - e + 2*Sqrt[c^2*d*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e)] - 6*PolyLog[3, -(((c^2*d + e + 2*Sqrt[c^2*d
*e])*E^((2*I)*ArcTan[c*x]))/(c^2*d - e))]))/(24*d)

Maple [F]

\[\int \frac {\left (a +b \arctan \left (c x \right )\right )^{2}}{x \left (e \,x^{2}+d \right )}d x\]

[In]

int((a+b*arctan(c*x))^2/x/(e*x^2+d),x)

[Out]

int((a+b*arctan(c*x))^2/x/(e*x^2+d),x)

Fricas [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (e x^{2} + d\right )} x} \,d x } \]

[In]

integrate((a+b*arctan(c*x))^2/x/(e*x^2+d),x, algorithm="fricas")

[Out]

integral((b^2*arctan(c*x)^2 + 2*a*b*arctan(c*x) + a^2)/(e*x^3 + d*x), x)

Sympy [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\int \frac {\left (a + b \operatorname {atan}{\left (c x \right )}\right )^{2}}{x \left (d + e x^{2}\right )}\, dx \]

[In]

integrate((a+b*atan(c*x))**2/x/(e*x**2+d),x)

[Out]

Integral((a + b*atan(c*x))**2/(x*(d + e*x**2)), x)

Maxima [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (e x^{2} + d\right )} x} \,d x } \]

[In]

integrate((a+b*arctan(c*x))^2/x/(e*x^2+d),x, algorithm="maxima")

[Out]

-1/2*a^2*(log(e*x^2 + d)/d - 2*log(x)/d) + integrate((b^2*arctan(c*x)^2 + 2*a*b*arctan(c*x))/(e*x^3 + d*x), x)

Giac [F]

\[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2}}{{\left (e x^{2} + d\right )} x} \,d x } \]

[In]

integrate((a+b*arctan(c*x))^2/x/(e*x^2+d),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \frac {(a+b \arctan (c x))^2}{x \left (d+e x^2\right )} \, dx=\int \frac {{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{x\,\left (e\,x^2+d\right )} \,d x \]

[In]

int((a + b*atan(c*x))^2/(x*(d + e*x^2)),x)

[Out]

int((a + b*atan(c*x))^2/(x*(d + e*x^2)), x)